class Person:

    def __init__(self,name):
        self.name = name

    @property # 此装饰器会把方法名当作属性名 return值
    def age(self):
        return 18
    
p1 = Person('张三')

print(p1.age)